import React from "react";
import { useSelector } from "react-redux";
import type { StateType } from "../store";
import { ComponentConfType } from "../components/QuestionComponents";
import { ComponentsStateType } from "../store/componentsReducer";
export default function useGetComponentInfo() {
  const compInfo = useSelector<StateType>(state => state.components.present) as ComponentsStateType
  console.log('compInfo', compInfo);
  const selectedComponent = compInfo.componentList.find(i => i.fe_id === compInfo.selectedId)
  return { ...compInfo, selectedComponent }

}


